package org.opens.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.opens.dao.MethodLogMapper;
import org.opens.entity.MethodLogEntity;
import org.opens.service.MethodLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Slf4j
public class MethodLogServiceImpl implements MethodLogService {

    @Autowired
    private MethodLogMapper methodLogMapper;

    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public void nonTransactionalInsertion(String methodName) {
        MethodLogEntity methodLogEntity = new MethodLogEntity();
        methodLogEntity.setMethodName(methodName);
        methodLogMapper.insert(methodLogEntity);
    }

}
